import { VariableSizeList } from "./react-window";
import './variable-size-list.css'


const rowSizes = new Array(1000).fill(0).map(() => Math.round(Math.random() * 75) + 25);
const getItemSize = index => rowSizes[index];

function Row({index, style}) {
    return (
        <div className={index%2 ? 'ListItemOdd' : 'ListItemEven'} style={style}>
            Row {index}
        </div>
    )
}

function App() {
    return (
        <VariableSizeList
            className="List"
            height={200}
            width={200}
            itemSize={getItemSize}
            itemCount={1000}
        >
            {Row}
        </VariableSizeList>
    )
}

export default App